package com.regex;
/**
 * PhoneNumber..
 *
 * @author Lizhong
 * @date 2019/3/20
 */
public class PhoneNumber {
    public static void main(String[] args) {
        String s = "^[1][\\d]{10}$";
        String  reg="^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$";
        String phone ="18536821124";
        String phone2 ="218568x1124";
        boolean matches = phone.matches(reg);

        boolean matches2 = phone2.matches(s);
        System.out.println(matches+""+matches2);
    }
}
